/*-
 * PDUElement.java
 *
 * $LastChangedBy:  $
 * $LastChangedRevision:  $
 * $LastChangedDate:  $
 * $HeadURL: $
 *
 * Copyright (c) 2007, Stein Gunnar Bakkeby
 * All rights reserved.
 * Redistribution and use in source and binary forms, with or without
 * modification, are permitted provided that the following conditions are met:
 *
 *     * Redistributions of source code must retain the above copyright
 *       notice, this list of conditions and the following disclaimer.
 *     * Redistributions in binary form must reproduce the above copyright
 *       notice, this list of conditions and the following disclaimer in the
 *       documentation and/or other materials provided with the distribution.
 *     * Neither the name of Stein Gunnar Bakkeby nor the names of its
 *       contributors may be used to endorse or promote products derived
 *       from this software without specific prior written permission.
 *
 * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS "AS IS" AND ANY
 * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
 * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
 * DISCLAIMED. IN NO EVENT SHALL THE REGENTS AND CONTRIBUTORS BE LIABLE FOR ANY
 * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
 * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
 * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
 * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
 * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
 */
package com.googlecode.attention.sms.pdu;

import static com.googlecode.attention.util.bit.ByteBitValues.B0;
import static com.googlecode.attention.util.bit.ByteBitValues.B1;
import static com.googlecode.attention.util.bit.ByteBitValues.B2;
import static com.googlecode.attention.util.bit.ByteBitValues.B3;
import static com.googlecode.attention.util.bit.ByteBitValues.B4;
import static com.googlecode.attention.util.bit.ByteBitValues.B5;
import static com.googlecode.attention.util.bit.ByteBitValues.B6;
import static com.googlecode.attention.util.bit.ByteBitValues.B7;

/**
 * This enum represents all elements of the SMS binary encoding. The TP prefix
 * stands for &quot;transport protocol&quot;.
 *
 * @author Stein Gunnar Bakkeby
 */
public enum PDUElement {
  /** This represents the first octet of the PDU. */
  TP_FO(),
  /** 
   * This represents the Failure-Cause of the PDU.
   * <BR>Note: Only for TP-ERROR
   */
  TP_FCS(),
  /** This represents the Parameter-Indicator of the PDU. */
  TP_PI(),
  /** This represents the Protocol-Identifier of the PDU. */
  TP_PID(),
  /** This represents the Data-Coding-Scheme of the PDU. */
  TP_DCS(),
  /** This represents the Message-Reference of the PDU. */
  TP_MR(),
  /** This represents the Message-Number of the PDU. */
  TP_MN(),
  /** This represents the Command-Type of the PDU. */
  TP_CT(),
  /** This represents the User-Data of the PDU. */
  TP_UD(),
  /** This represents the Destination-Address of the PDU. */
  TP_DA(),
  /** This represents the Originating-Address of the PDU. */
  TP_OA(),
  /** This represents the Type-of-Address of an address */
  TP_TOA(),
  /** This represents the Type-of-Number of an address */
  TP_TON(),
  /** This represents the Numbering-Plan-Identification of an address */
  TP_NPI(),
  /** This represents the Command-Data of the PDU. */
  TP_CD(),
  /** This represents the Service-Center-Time-Stamp. */
  TP_SCTS(),
  /** This represents the User-Data-Length. */
  TP_UDL(),
  /** This represents the Message-Type-Indicator. */
  TP_MTI(B1|B0),
  /** This represents the More-Messages-to-Send. */
  TP_MMS(B2),
  /** This represents the Reply-Path. */
  TP_RP(B7),
  /** This represents the User-Data-Header-Indication. */
  TP_UDHI(B6),
  /** This represents the User-Data-Header. */
  TP_UDH(),
  /** This represents the User-Data-Header. */
  TP_UDHL(),
  /** This represents the Status-Report-Indication. */
  TP_SRI(B5),
  /** This represents the Status-Report-Request. */
  TP_SRR(B5),
  /** This represents the Validity-Period-Format. */
  TP_VPF(),
  /** This represents the Reject-Duplicates. */
  TP_RD(B2),
  /** This represents the Command-Data-Length. */
  TP_CDL(),
  /** This represents the Status-Report-Qualifier. */
  TP_SRQ(B5),
  /** This represents the Recipient-Address. */
  TP_RA(),
  /** This represents the Discharge-Time. */
  TP_DT(),
  /** This represents the Status. */
  TP_ST(),
  /** This represents the Validity-Period. */
  TP_VP(B4|B3);
  
  /**
   * This represents the element's binary value, if any. This value will
   * be 0 if it does not apply.
   */
  public final int value;
  
  private PDUElement() {
    value = 0;
  }
  
  private PDUElement(final int value) {
    this.value = value;
  }
}